package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.mall.lib.domain.enumclass.SysMessageStatus;
import com.rockcent.mall.lib.domain.enumclass.SysMessageType;
import com.rockcent.mall.lib.domain.enumclass.TerminalType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by zhangjh on 2017/5/22.
 */
@Entity
@Table(name = "sys_message")
@DynamicInsert
@DynamicUpdate
public class SysMessage extends IDEntityMall {

    /**
     * 类型
     */
    @Column(columnDefinition = "varchar(100)")
    @Enumerated(EnumType.STRING)
    private SysMessageType type;

    /**
     * 消息内容
     */
    @Column(columnDefinition = "varchar(500) comment '消息内容'")
    private String content;

    /**
     * 目的地：前端url
     */
    @Column(columnDefinition = "varchar(500) comment '前端url'")
    private String frontendUrl;

    /**
     * 目的地：前端url
     */
    @Column(columnDefinition = "varchar(500) comment '不带参数的前端url'")
    private String frontendResourceUrl;


    /**
     * 消息触发的：后端url
     */
    @Column(columnDefinition = "varchar(500) comment '后端url'")
    private String backendUrl;

    /**
     * 终端类型
     */
    @Column(columnDefinition = "varchar(30) comment '终端类型'")
    @Enumerated(EnumType.STRING)
    private TerminalType terminalType;


    public SysMessageType getType() {
        return type;
    }

    public void setType(SysMessageType type) {
        this.type = type;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFrontendUrl() {
        return frontendUrl;
    }

    public void setFrontendUrl(String frontendUrl) {
        this.frontendUrl = frontendUrl;
    }

    public String getBackendUrl() {
        return backendUrl;
    }

    public void setBackendUrl(String backendUrl) {
        this.backendUrl = backendUrl;
    }


    public String getFrontendResourceUrl() {
        return frontendResourceUrl;
    }

    public void setFrontendResourceUrl(String frontendResourceUrl) {
        this.frontendResourceUrl = frontendResourceUrl;
    }

    public TerminalType getTerminalType() {
        return terminalType;
    }

    public void setTerminalType(TerminalType terminalType) {
        this.terminalType = terminalType;
    }




    @Override
    public String toString() {
        return "SysMessage{" +
                "type=" + type +
                ", content='" + content + '\'' +
                ", frontendUrl='" + frontendUrl + '\'' +
                ", frontendResourceUrl='" + frontendResourceUrl + '\'' +
                ", backendUrl='" + backendUrl + '\'' +
                ", terminalType=" + terminalType +
                '}';
    }
}
